﻿using System.Data.Entity.ModelConfiguration;

namespace NerdDinnerReloaded.Models
{
    public class RSVP : NerdDinnerEntity
    {
        public int DinnerID { get; set; }
        public string AttendeeEmail { get; set; }

        public virtual Dinner Dinner { get; set; }
    }

    public class RSVPConfiguration : EntityConfiguration<RSVP>
    {
        public RSVPConfiguration()
            : base()
        {
            MapSingleType(rsvp => new
                                      {
                                          rsvp_id = rsvp.ID,
                                          dinner_id = rsvp.DinnerID,
                                          attendee_email = rsvp.AttendeeEmail,
                                          created_dttm = rsvp.CreatedOn,
                                          created_by = rsvp.CreatedBy,
                                          modified_by = rsvp.ModifiedBy,
                                          modified_on = rsvp.ModifiedOn
                                      }).ToTable("tbRSVP");
        }
    }
}